/*
 * @Author: xiaotiwen
 * @Date: 2020-06-22 10:33:03
 * @LastEditTime: 2020-07-20 16:32:10
 * @LastEditors: xiaotiwen
 * @FilePath: \eduweb\src\api\practiceManagement\internSetup.js
 * @Description:
 */
import fetch from 'common/src/utils/fetch'
import baseUrl from './env'
import UTILS from 'common/src/utils/utils'

// 新增实习设置
export function addLabel(data) {
    return fetch({
        // url: "/api/trainningservice/udgPtSettingT/add",
        url: `${baseUrl}/udgPtSettingT/add`,
        method: 'post',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    })
}
// 编辑实习设置
export function update(data) {
    return fetch({
        url: `${baseUrl}/udgPtSettingT/update`,
        method: 'post',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    })
}

// 删除实习设置
export function deleApi(data) {
    return fetch({
        url: `${baseUrl}/udgPtSettingT/delete`,
        method: 'post',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    })
}
// 根据条件，分页查询实习设置
export function queryList(pageNum_, pageSize_, conditions) {
    return fetch({
        url: `${baseUrl}/udgPtSettingT/query`,
        method: 'POST',
        headers: {
            'Content-Type': 'application/json'
        },
        data: {
            pageNum_: pageNum_,
            pageSize_: pageSize_,
            condition: {
                yearTerm: conditions
            }
        }
    })
}

// 根据条件，分页查询实习基地
export function udgPtBaseInfoList(pageNum_, pageSize_, condition) {
    return fetch({
        url: `${baseUrl}/udgPtBaseInfo/query`,
        method: 'POST',
        headers: {
            'Content-Type': 'application/json'
        },
        data: {
            pageNum_: pageNum_,
            pageSize_: pageSize_,
            condition
        }
    })
}
// 新增实习基地
export function addudgPtBaseInfo(data) {
    return fetch({
        url: `${baseUrl}/udgPtBaseInfo/add`,
        method: 'post',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    })
}

// 编辑实习基地
export function updateudgPtBaseInfo(data) {
    return fetch({
        url: `${baseUrl}/udgPtBaseInfo/update`,
        method: 'post',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    })
}

// 删除实习基地
export function deleteudgPtBaseInfo(id) {
    return fetch({
        url: `${baseUrl}/udgPtBaseInfo/delete?id=${id}`,
        method: 'get'
    })
}
// 审核习基地
export function submitReview(data) {
    return fetch({
        url: `${baseUrl}/udgPtBaseInfo/submitReview`,
        method: 'post',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    })
}

//导出实习基地
export function exportBaseInfo(data) {
    return fetch({
        url: `${baseUrl}/udgPtBaseInfo/exportBaseInfo`,
        method: 'post',
        responseType: 'blob',
        data
    }).then(res => {
        UTILS.downloadFile(res, '实习基地信息', 'application/vnd.ms-excel;charset=utf-8')
    })
}

// 根据条件，分页查询实习基地统计
export function queryStatistics(pageNum_, pageSize_, conditions) {
    return fetch({
        url: `${baseUrl}/udgPtBaseInfo/queryStatistics`,
        method: 'POST',
        headers: {
            'Content-Type': 'application/json'
        },
        data: {
            pageNum_: pageNum_,
            pageSize_: pageSize_,
            condition: {
                yearTerm: conditions
            }
        }
    })
}
//导出实习基地统计
export function exportStatistics(data) {
    return fetch({
        url: `${baseUrl}/udgPtBaseInfo/exportStatistics`,
        method: 'post',
        responseType: 'blob',
        data
    }).then(res => {
        UTILS.downloadFile(res, '实习基地统计.xls', 'application/vnd.ms-excel;charset=utf-8')
    })
}

export function udgPtCourseInfo(data) {
    return fetch({
        url: `${baseUrl}/udgPtCourseInfoT/query`,
        method: 'post',
        data
    })
}
//初始化列表
export function getCourseInfoList(data) {
    return fetch({
        url: `${baseUrl}/udgPtCourseInfoT/query`,
        method: 'POST',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    })
}

//课程确认管理-列表
export function getCourseConfirmationList(data) {
  return fetch({
    url: `${baseUrl}/udgPtCourseInfoT/courseConfirmationQuery`,
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data
  })
}

// 删除课程初始化
export function deleudgPtCourse(data) {
    return fetch({
        url: `${baseUrl}/udgPtCourseInfoT/delete`,
        method: 'post',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    })
}

//课程初始化
export function initCourse(data) {
    return fetch({
        url: `${baseUrl}/udgPtCourseInfoT/initCourse`,
        method: 'post',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    })
}

//新增课程初始化
export function queryCultureCourse(data) {
    return fetch({
        url: `${baseUrl}/udgPtCourseInfoT/queryCultureCourse`,
        method: 'post',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    })
}

//确认新增课程
export function addudgPtCourseInfo(data) {
    return fetch({
        url: `${baseUrl}/udgPtCourseInfoT/add`,
        method: 'post',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    })
}

//导出课程初始化
export function exportUdgptCourseInfo(data) {
    return fetch({
        url: `${baseUrl}/udgPtCourseInfoT/export`,
        method: 'post',
        responseType: 'blob',
        data
    }).then(res => {
        UTILS.downloadFile(res, '课程初始化信息', 'application/vnd.ms-excel;charset=utf-8')
    })
}

//导出课程确认管理
export function exportUdgptCourseInfoNew(data) {
  return fetch({
      url: `${baseUrl}/udgPtCourseInfoTConfirm/export`,
      method: 'post',
      responseType: 'blob',
      data
  }).then(res => {
      UTILS.downloadFile(res, '课程确认管理列表', 'application/vnd.ms-excel;charset=utf-8')
  })
}

//  修改
export function updateConfirm(data) {
    return fetch({
        url: `${baseUrl}/udgPtCourseInfoTConfirm/update`,
        method: 'post',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    })
}
